﻿using System;
using System.Linq;

namespace YArchitech.Public.ExcelToView
{
	internal static class StaticResources
	{
		internal static string TitleBlockFamilyName
		{
			get
			{
				return StaticResources.titleBlockFamilyName;
			}
		}

		internal static string PathOfTitleBlockFamiyName
		{
			get
			{
				return StaticResources.pathOfTitleBlockFamilyName;
			}
		}

		internal static string[] ColumnName
		{
			get
			{
				return StaticResources.columnName;
			}
		}

		internal static int[] WantColumnIndex
		{
			get
			{
				return StaticResources.wantColumnIndex;
			}
			set
			{
				StaticResources.wantColumnIndex = value;
				int num = StaticResources.wantColumnIndex.Min();
				StaticResources.columnIndexInSql = (int[])StaticResources.wantColumnIndex.Clone();
				for (int i = 0; i < StaticResources.columnIndexInSql.Length; i++)
				{
					StaticResources.columnIndexInSql[i] = StaticResources.columnIndexInSql[i] - num;
				}
			}
		}

		internal static int[] ColumnIndexInSql
		{
			get
			{
				return StaticResources.columnIndexInSql;
			}
		}

		internal static string[] ExcelExtend
		{
			get
			{
				return StaticResources.excelExtend;
			}
		}

		internal static string[][] LinkString
		{
			get
			{
				return StaticResources.linkString;
			}
		}

		internal static string TableName
		{
			get
			{
				return StaticResources.tableName;
			}
			set
			{
				if (!string.IsNullOrEmpty(StaticResources.tableName) && !string.IsNullOrWhiteSpace(StaticResources.tableName))
				{
					StaticResources.tableName = value;
					return;
				}
				StaticResources.tableName = null;
			}
		}

		internal static string Str_TABLE
		{
			get
			{
				return StaticResources.str_TABLE;
			}
		}

		internal static string Str_TABLENAME
		{
			get
			{
				return StaticResources.str_TABLENAME;
			}
		}

		internal static string SqlStr_Select(string tableName)
		{
			string arg = string.Empty;
			int n = StaticResources.wantColumnIndex.Min();
			int n2 = StaticResources.wantColumnIndex.Max();
			arg = Utility.ConvertToExcelTitle(n) + ":" + Utility.ConvertToExcelTitle(n2);
			return string.Format("SELECT * FROM [{0}{1}]", tableName, arg);
		}

		internal static string[] HyTitleBlockNameBase
		{
			get
			{
				return StaticResources.hyTitleBlockNameBase;
			}
		}

		internal static string[] BaseStringOfDriection
		{
			get
			{
				return StaticResources.baseStringOfDriection;
			}
		}

		private static string titleBlockFamilyName = "HY-图框（横版）.rfa";

		private static string pathOfTitleBlockFamilyName = "F:\\BIMSPACE\\ExcelToView\\";

		private static string[] columnName = new string[]
		{
			"图纸编号",
			"图纸名称",
			"图框",
			"图纸方向"
		};

		private static int[] wantColumnIndex = new int[]
		{
			0,
			1,
			2,
			3
		};

		private static int[] columnIndexInSql = new int[]
		{
			0,
			1,
			2,
			3
		};

		private static int[] wantSheetIndex = new int[1];

		private static string[] excelExtend = new string[]
		{
			".xls",
			".xlsx"
		};

		private static string[][] linkString = new string[][]
		{
			new string[]
			{
				"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=",
				";Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1;\""
			},
			new string[]
			{
				"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=",
				";Extended Properties=\"Excel 12.0;HDR=NO;IMEX=1;\""
			}
		};

		private static string tableName = null;

		private static string str_TABLE = "TABLE";

		private static string str_TABLENAME = "TABLE_NAME";

		private static string[] hyTitleBlockNameBase = new string[]
		{
			"HY-图框",
			"图框"
		};

		private static string[] baseStringOfDriection = new string[]
		{
			".*横.*",
			".*竖.*"
		};
	}
}
